Scroll to navigation

lsm_local_disk_rpm_get(3) Libstoragemgmt C API Manual lsm_local_disk_rpm_get(3)

NAME

lsm_local_disk_rpm_get - Query disk rotation speed.

SYNOPSIS

int lsm_local_disk_rpm_get (const char *disk_path, int32_t *rpm, lsm_error **lsm_err);

ARGUMENTS

String. The path of disk block, example: "/dev/sdb", "/dev/nvme0n1".
Output pointer of int32_t.
Output pointer of lsm_error. Error message could be retrieved via lsm_error_message_get. Memory should be freed by lsm_error_free.

VERSION

1.3

DESCRIPTION

Query the disk rotation speed - revolutions per minute(RPM) of specified disk path. Requires permission to open disk path(root user or disk group).

Possible values of rpm are:


* -1(LSM_DISK_RPM_UNKNOWN):
Unknown RPM.
* 0(LSM_DISK_RPM_NON_ROTATING_MEDIUM):
Non-rotating medium (e.g., SSD).


* 1(LSM_DISK_RPM_ROTATING_UNKNOWN_SPEED):
Rotational disk with unknown speed.
* >1:
Normal rotational disk (e.g., HDD).

RETURN

Error code as enumerated by 'lsm_error_number':
* LSM_ERR_OK
On success or not found.
* LSM_ERR_INVALID_ARGUMENT
When any argument is NULL
* LSM_ERR_LIB_BUG
When something unexpected happens.
* LSM_ERR_NOT_FOUND_DISK
When provided disk path not found.
* LSM_ERR_PERMISSION_DENIED
No sufficient permission to access provided disk path.

lsm_local_disk_rpm_get May 2019